<template>
	<view>
		<view class='uni_my'>
			<image style="" src="../../static/logo.png"></image>
			<view class="uni_my_login">登陆/注册</view>
			<view class="uni_my_welcome">澳门欢迎您！</view>
		</view>
		<!-- <view class="uni_bottom" v-for="(item,index) in myList" :key="index">
			<view class="uni_bottom_dispaly">
				<image style="margin-right: 50rpx;" src="../../static/images/Hearts.png"></image>
				<view class="uni_bottom_my">{{item.my}}</view>
			</view>
			<image src="../../static/images/right.png"></image>
		</view> -->
		<view class="box " :class="{ 'shakeX': is_flag }"></view>
		<button @click="mmd()">变化 </button>

		<button type="primary" @click="open">fade</button>
		<uni-transition mode-class="slide-top" :styles="{'width':'100px','height':'100px','backgroundColor':'red'}"
			:show="show" @change="change" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				is_flag: false, // 初始时不触发动画  
				show: true,
				modeClass: 'fade',
				styles: {},
				myList: [{
						my: '我的收藏'
					}, {
						my: '我的订单'
					}, {
						my: '我的评价'
					}, {
						my: '我的推荐官'
					}, {
						my: '紧急联络'
					}, {
						my: '智能客服'
					},
					{
						my: '切换语言'
					}
				]
			}
		},
		onLoad() {



		},
		onShow() {

		},
		methods: {
			mmd() {
				this.is_flag = !this.is_flag;
				console.log(this.is_flag);
			},
			open(mode) {
				this.show = !this.show
			},
			change() {
				console.log('触发动画')
			}
		}
	}
</script>

<style scoped lang="scss">
	.uni_my {
		margin: 0 auto;
		text-align: center;
		border: 1rpx solid #E5E5E5;
		border-bottom-left-radius: 300rpx;
		border-bottom-right-radius: 300rpx;
		background-color: #E5E5E5;

		image {
			width: 150rpx;
			height: 150rpx;
			border-radius: 50%;
			margin-top: 50rpx;
		}

		&_login {
			margin-top: 20rpx;
			font-size: 30rpx;
			font-weight: 600;

		}

		&_welcome {
			text-align: center;
			margin-top: 50rpx;
			font-size: 30rpx;
			font-weight: 600;
			margin-bottom: 80rpx;

		}
	}

	.uni_bottom {
		// border: 1rpx solid red;
		margin: 30rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;

		image {
			width: 50rpx;
			height: 50rpx;

		}

		&_my {
			font-size: 30rpx;
			font-weight: 600;

		}

		&_dispaly {
			// width: 250rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
		}
	}

	@keyframes shakeX {

		from,
		to {
			transform: translate3d(0, 0, 0);
		}

		10%,
		30%,
		50%,
		70%,
		90% {
			transform: translate3d(-10px, 0, 0);
		}

		20%,
		40%,
		60%,
		80% {
			transform: translate3d(10px, 0, 0);
		}
	}

	.shakeX {
		animation-name: shakeX;
		animation-duration: 1s;
	}

	.box {
		width: 100rpx;
		height: 100rpx;
		background-color: green;
	}
</style>